package com.example.android.services

import android.util.Log
import com.example.android.extensions.StringBody
import com.example.android.models.User
import com.example.android.utils.Api
import com.example.android.utils.JsonUtil
import com.example.android.utils.models.Form
import com.example.android.utils.models.MyResult
import kotlin.math.log


class PayService(private val _Api: Api, private val _JsonUtil: JsonUtil){
    suspend fun confirm(user: User): MyResult<String>{

        val resJson = _Api.Post("/pay/scene-do", _JsonUtil.ToJson(user)).StringBody()
        Log.d(toString(), resJson)
        val result = _JsonUtil.FromJsonObject(resJson).AsMyResult<String>()
        return MyResult(MyResult.OK, result.Message)
    }
}